//General Variables\\
SWEP.AdminSpawnable = true
SWEP.ViewModelFOV = 64
SWEP.ViewModel = "models/weapons/v_irifle.mdl"
SWEP.WorldModel = "models/weapons/w_irifle.mdl"
SWEP.AutoSwitchTo = false
SWEP.Slot = 1
SWEP.HoldType = "smg"
SWEP.PrintName = "Rocket Gun"
SWEP.Author = "FaceGuydb"
SWEP.Spawnable = true
SWEP.AutoSwitchFrom = false
SWEP.FiresUnderwater = true
SWEP.Weight = 5
SWEP.DrawCrosshair = true
SWEP.Category = "RaceGM"
SWEP.SlotPos = 0
SWEP.DrawAmmo = true
SWEP.ReloadSound = "Weapon_Pistol.Reload"
SWEP.Instructions = "Shoot Rockets From RaceGM"
SWEP.Contact = "matchheadstudios@gmail.com"
SWEP.Purpose = "Admin abuse"
SWEP.base = "weapon_base"
//General Variables\\

//Primary Fire Variables\\
SWEP.Primary.Sound = "Weapon_Pistol.Single"
SWEP.Primary.Damage = 100
SWEP.Primary.TakeAmmo = 1
SWEP.Primary.ClipSize = 1000
SWEP.Primary.AngVelocity = Angle(0,0,0)
SWEP.Primary.Ammo = "Pistol"
SWEP.Primary.DefaultClip = 1000
SWEP.Primary.Spread = 0.1
SWEP.Primary.Model = "models/jaanus/shuriken_huge.mdl"
SWEP.Primary.NumberofShots = 1
SWEP.Primary.Automatic = true
SWEP.Primary.Recoil = 0.2
SWEP.Primary.Delay = 0.1
SWEP.Primary.Force = 1000000
//Primary Fire Variables\\

SWEP.Secondary.Sound = "Weapon_Pistol.Single"
SWEP.Secondary.Damage = 100
SWEP.Secondary.TakeAmmo = 1
SWEP.Secondary.ClipSize = 1000
SWEP.Secondary.AngVelocity = Angle(0,0,0)
SWEP.Secondary.Ammo = "Pistol"
SWEP.Secondary.DefaultClip = 1000
SWEP.Secondary.Spread = 0.1
SWEP.Secondary.Model = "models/jaanus/shuriken_huge.mdl"
SWEP.Secondary.NumberofShots = 1
SWEP.Secondary.Automatic = true
SWEP.Secondary.Recoil = 0.2
SWEP.Secondary.Delay = 0.1
SWEP.Secondary.Force = 1000000

//SWEP:Initialize()\\
function SWEP:Initialize()
	util.PrecacheSound(self.Primary.Sound)
	util.PrecacheSound(self.Secondary.Sound)
	if ( SERVER ) then
		self:SetWeaponHoldType( self.HoldType )
	end
end
//SWEP:Initialize()\\

//SWEP:PrimaryFire()\\
function SWEP:PrimaryAttack()
	self:TakePrimaryAmmo(self.Primary.TakeAmmo)
	self:Throw_Attack (self.Primary.Model, self.Primary.Sound, self.Primary.AngVelocity)
	self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
	self.Weapon:SetNextSecondaryFire( CurTime() + self.Primary.Delay )
end

function SWEP:SecondaryAttack()
	self:TakePrimaryAmmo(self.Primary.TakeAmmo)
	self:Throw_Attack2 (self.Primary.Model, self.Primary.Sound, self.Primary.AngVelocity)
	self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
	self.Weapon:SetNextSecondaryFire( CurTime() + self.Primary.Delay )
end
//SWEP:PrimaryFire()\\

//SWEP:Throw_Attack(Model, Sound, Angle)\\
function SWEP:Throw_Attack (Model, Sound, Angles)
	local tr = self.Owner:GetEyeTrace()
	self.Weapon:EmitSound (Sound)
	self.BaseClass.ShootEffects (self)
	if (!SERVER) then return end
	local missle = ents.Create("sent_missle")
	missle:SetPos (self.Owner:EyePos() + (self.Owner:GetAimVector() * 16))
	missle:SetAngles (self.Owner:EyeAngles()+Vector(180,0,0))
	missle:Spawn()
	missle:GetPhysicsObject():SetVelocity((self.Owner:GetForward() * 10000))
	//missle:Activate()
end
//Throw_Attack(Model, Sound, Angle)\\

function SWEP:Throw_Attack2 (Model, Sound, Angles)
	local tr = self.Owner:GetEyeTrace()
	self.Weapon:EmitSound (Sound)
	self.BaseClass.ShootEffects (self)
	if (!SERVER) then return end
	local missle = ents.Create("sent_bomb")
	missle:SetPos (self.Owner:EyePos() + self.Owner:GetForward() * 150)
	missle:Spawn()
	//missle:Activate()
end

function SWEP:Reload()
	for k,v in pairs(player.GetAll()) do
        if(v:Team() != 5)then
            v:Kill()
        end
    end
end

